﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Foundation {
    /// <summary>
    /// Über diese Klasse werden Effekte definiert. 
    /// </summary>
    public class Effekt {
        private Guid id;
        private int volume;


        public string Name { get; set; }
        public char Key { get; set; }
        public EffektTypeEnum Type { get; set; }
        public List<Track> Tracks { get; set; }
       
        public int Volume {
            get {
                return this.volume;

            }
            set {
                if (value > 100) {
                    this.volume = 100;
                }
                else if (value < 0) {
                    this.volume = 0;
                }
                else {
                    this.volume = value;
                }
            }
        }
        public Guid Id {
            get {
                if (this.id == Guid.Empty) {
                    this.id = Guid.NewGuid();
                }
                return this.id;
            }
            set {
                this.id = value;
            }
        }
        public Effekt followingEffect { get; set; }

        public Effekt() {
            this.Tracks = new List<Track>();
        }

        public override string ToString() {
            return string.Format("{0} - {1}", Key, Name);
        }
    }
}
